import { getUserDepID, getCompanyID, getUserID } from '@/utils';

/**  资产信息变更列表 Manage数据范围权限判断 */
export const ApplyManageTab = (curRes: Record<string, any>) => {
  if (curRes?.['/assetApplyChange/createCompanyID']) {
    return {
      createCompanyID: getCompanyID(),
      params: 'createCompanyID',
    };
  } else if (curRes?.['/assetApplyChange/createDepartmentID']) {
    return {
      createDepartmentID: getUserDepID(),
      params: 'createDepartmentID',
    };
  } else if (curRes?.['/assetApplyChange/createrID']) {
    return {
      createrID: getUserID(),
      params: 'createrID',
    };
  } else {
    return {};
  }
};

/**  资产信息变更申请弹出框选择资产列表 Manage数据范围权限判断 */
export const AssetListManageTab = (curRes: Record<string, any>) => {
  if (curRes?.['/assetController/assetCompanyID']) {
    return {
      assetCompanyID: getCompanyID(),
      params: 'assetCompanyID',
    };
  } else if (curRes?.['/assetController/assetDepartmentID']) {
    return {
      assetDepartmentID: getUserDepID(),
      params: 'assetDepartmentID',
    };
  } else if (curRes?.['/assetController/userID']) {
    return {
      userID: getUserID(),
      params: 'userID',
    };
  } else {
    return {};
  }
};
